home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
powerb5.zip
/
P5WPR008.TIP
< prev
next >
Wrap
Text File
|
1993-06-01
|
2KB
|
62 lines
I've used Word for Windows for over two years and miss a
feature found in most other word processors: File Delete.
True, you can delete a file through the File·Find File
command, but you first have to wait while WinWord searches
the disk.
So I wrote a simple macro that deletes any file on any disk.
After assigning it to the File menu (where God intended it
to be), I can now select File·Delete (which I can do with
the mouse or by pressing <Alt>-F, then D), and I'm prompted
for a file name. If my macro can't find a file with that
name, a dialog box tells me so.
Greg M. Perry
Tulsa, Oklahoma
Editor's Note: To use this macro, start Word for Windows and
use the Insert·File... command to import the text of the
macro from the file P5WPR\WWDEL.TXT (found on your PowerBase
*.* Volume 5 diskette) into a new Word for Windows document.
Then copy the body of the macro to the clipboard, omitting
the Sub Main statement at the top and the End Sub statement
at the bottom. Next, select Tools·Macros, type DeleteFile as
your macro name, and select Edit. Paste the macro text
between the Sub and End Sub statements in the macro editing
window. Finally, double click on the "go away" box in the
upper left corner of the editing window and tell Word for
Windows that you want to save the macro.
Next, put the macro on the File menu. Select Tools·Options,
then press M to select the Menus category. Make sure the
Menu box reads '&File'. Click on DeleteFile in the Macros
list box and click Add. A Delete File item will appear at
the bottom of the file menu. Click Close to exit.
This isn't a particularly complicated macro, but it is very
useful and shows how you can add new commands to Word for
Windows' menus. Unfortunately, Word for Windows' menu editor
does have one awkward feature: You can add new items only at
the bottom of the menu, so the new Delete File item winds up
at the bottom instead of next to Find File, where you'd
expect to find it.
The text of the macro is shown below.
---- BEGIN LISTING ----
Sub MAIN
' Delete a file from the disk
Input "File to delete" ; fil$
' Erase the file
If(len(fil$) > 0) Then Kill fil$
End Sub
---- END LISTING ----
Title: Word for Windows Does Deletions
Category: WPR
Issue Date: November, 1992
Editor: Brett Glass
Supplementary Files: P5WPR\WWDEL.TXT
Filename: P5WPR008.TIP